import { OnlineService } from './online.service'
import { ForceLogoutDTO, TableQuery } from '@/common'
import { Controller, Delete, Get, Query } from '@nestjs/common'

@Controller('monitor/online')
export class OnlineController {
  constructor(private readonly onlineService: OnlineService) {}

  /**分页列表查询 */
  @Get('list')
  public findList(@TableQuery() queryParams: TableQueryParams<{ address: string; username: string }>) {
    return this.onlineService.findList(queryParams)
  }

  /** 强制用户退出登录，清除与该用户相关的所有 Redis 缓存 */
  @Delete('forceLogout')
  public forceLogout(@Query() data: ForceLogoutDTO) {
    return this.onlineService.forceLogout(data)
  }
}
